package com.cosmoplat.mom.iot.client.api.param;

import com.cosmoplat.mom.iot.client.IotApi;
import com.cosmoplat.mom.iot.client.constants.IotApis;
import com.cosmoplat.mom.iot.client.http.HttpRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 根据设备类型ID查询设备列表参数
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class GetDeviceListByTypeIdParam extends BaseIotParam {
    
    /**
     * 设备类型主键
     */
    private String deviceTypeId;
    
    @Override
    public void check() {
        // 设备类型ID必须提供
        if (deviceTypeId == null || deviceTypeId.isEmpty()) {
            throw new IllegalArgumentException("deviceTypeId cannot be null or empty");
        }
    }
    
    @Override
    public IotApi api() {
        return IotApis.DEVICE_LIST_BY_TYPE_ID;
    }

    @Override
    public HttpRequest customizeHttpRequest(HttpRequest request) {
        return request.addQueryParam(this);
    }
}